@use "vars" as *;

.social i {
    display: inline;
    font-size: 1.9em;
}

.facebook-this, .tweet-this {
    display: inline;
}

.tweet-this i {
    color: #55ACEE;
}

.facebook-this i {
    color: #133783;
}

.social {
    font-size: 1.3em;
    float: right;
}

// Bootstrap-y buttons
.button, button, input[type=submit] {
    color: white !important;
    text-decoration: none !important;
    cursor: pointer;
    vertical-align: middle;
    white-space: nowrap;
    font-weight: 400;
    line-height: 1.4;
    background: rgb(51, 122, 183) none repeat scroll 0 (0% / auto) padding-box border-box;
    background: -webkit-linear-gradient(top, #337ab7 0, #265a88 100%) repeat-x;
    background: linear-gradient(to bottom, #337ab7 0, #265a88 100%) repeat-x;
    border-radius: $widget_border_radius;
    padding: 6px 12px;
    display: block;
    border: 1px solid #245580;
    text-align: center;

    // 4k hack
    font-size: $base_font_size;

    &:hover {
        background: #265a88;
    }

    &:active {
        border-color: #245580;
        background: #265a88;
    }

    &.full {
        padding: 6px 0;
    }

    &.disabled {
        background: linear-gradient(to bottom, darkgray 0, gray 100%) repeat-x !important;
        border-color: grey !important;
        cursor: not-allowed;
    }
}

.inline-button {
    display: inline;
    vertical-align: top;
    padding: 3px 6px;
}

input {
    &[type=text], &[type=password], &[type=email], &[type=number] {
        padding: 4px 8px;
        color: $color_primary75;
        background: $color_primary0 none;
        border: 1px solid $color_primary25;
        border-radius: $widget_border_radius;
        box-shadow: 0 1px 1px rgba($color_primary100, 0.075) inset;
        transition: border-color 0.15s ease-in-out 0s, box-shadow 0.15s ease-in-out 0s;
        box-sizing: border-box;

        // Need this explicitly because UA stylesheet for Chrome on 4k makes
        // everything look bad otherwise (forces it to 9.3px)
        font-size: $base_font_size;

        &:hover {
            border-color: rgba(82, 168, 236, 0.8);
            box-shadow: inset 0 1px 1px rgba($color_primary100, 0.075), 0 0 4px rgba(82, 168, 236, 0.6);
        }

        &:focus {
            border-color: rgba(82, 168, 236, 0.8);
            box-shadow: inset 0 1px 1px rgba($color_primary100, 0.075), 0 0 8px rgba(82, 168, 236, 0.6);
            outline: 0;
        }
    }

    &[type=number] {
        padding: 2px 0 2px 5px;
    }

    &[type=checkbox] {
        appearance: none;
        vertical-align: middle;
        border: 1px solid $color_primary50;
        background: $color_primary0;
        border-radius: 2px;
        width: 0.95em;
        height: 0.95em;
        cursor: pointer;

        &:checked {
            appearance: auto;
            accent-color: $highlight_blue;
        }
    }
}

textarea {
    padding: 4px 8px;
    color: $color_primary75;
    background: $color_primary0 none;
    border: 1px solid $color_primary25;
    border-radius: $widget_border_radius;
    box-shadow: 0 1px 1px rgba($color_primary100, 0.075) inset;
    transition: border-color 0.15s ease-in-out 0s, box-shadow 0.15s ease-in-out 0s;
    box-sizing: border-box;
}

textarea:hover {
    border-color: rgba(82, 168, 236, 0.8);
    box-shadow: inset 0 1px 1px rgba($color_primary100, 0.075), 0 0 4px rgba(82, 168, 236, 0.6);
}

textarea:focus {
    border-color: rgba(82, 168, 236, 0.8);
    box-shadow: inset 0 1px 1px rgba($color_primary100, 0.075), 0 0 8px rgba(82, 168, 236, 0.6);
    outline: 0;
}

// Bootstrap-y copy button
.btn-clipboard {
    top: 0;
    right: 0;
    display: block;
    font-size: 12px;
    color: $color_primary50;
    cursor: pointer;
    background-color: $color_pageBg;
    border: 1px solid $color_primary25;
    border-radius: 0 $widget_border_radius;
    position: absolute;
    padding: 5px 8px;
}

.copy-clipboard {
    position: relative;
    margin-top: 1.5em;
}

// Bootstrap-y tabs
.ul_tab_a_active {
    color: $color_primary100;
    // Cover up the bottom border of active tabs with this color
    background: $color_pageBg;
    cursor: default;
    border: 1px solid $color_primary25;
    border-bottom-color: $color_pageBg;
    border-image: none;
}

.tabs {
    border-bottom: 1px solid $color_primary25;
    margin: 0 0 8px;
    width: 100%;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;

    .tab {
        .tab-icon {
            padding-right: 0.3em;
            color: $color_primary50;
        }

        a, span {
            border-top-width: 3px !important;
        }

        &.active {
            a, span {
                border-top-color: $highlight_blue !important;
            }

            .tab-icon {
                color: $color_primary100;
            }
        }
    }

    h2 {
        color: $color_primary75;
    }

    > ul {
        margin: 0;
        margin-bottom: -1px;
        padding: 0;
        list-style: outside none none;
        display: flex;
        overflow-x: auto;
        overflow-y: hidden;

        > li {
            position: relative;
            display: block;

            &.active > a, &.active > span {
                @extend .ul_tab_a_active;

                &:hover {
                    @extend .ul_tab_a_active;
                }

                &:focus {
                    @extend .ul_tab_a_active;
                }
            }

            > a, > span {
                margin-right: 2px;
                line-height: 1.42857;
                border: 1px solid transparent;
                border-radius: $widget_border_radius $widget_border_radius 0 0;
                position: relative;
                display: block;
                padding: 10px 15px;
                color: $color_primary66;
                text-decoration: none;
                white-space: nowrap;
            }
        }
    }
}

// Bootstrap-y pagination
ul.pagination a:hover {
    background: rgba($color_primary100, 0.55);
}

ul.pagination {
    display: inline-block;
    padding-left: 0;
    margin: 0;

    > {
        li {
            display: inline;

            &:first-child > {
                a, span {
                    margin-left: 0;
                    border-top-left-radius: $widget_border_radius;
                    border-bottom-left-radius: $widget_border_radius;
                }
            }

            &:last-child > {
                a, span {
                    border-top-right-radius: $widget_border_radius;
                    border-bottom-right-radius: $widget_border_radius;
                }
            }

            > {
                a, span {
                    position: relative;
                    float: left;
                    padding: 4px 12px;
                    line-height: 1.42857;
                    text-decoration: none;
                    color: $color_primary0;
                    background-color: $color_primary75;
                    border: 1px solid $color_primary50;
                    margin-left: -1px;
                }
            }
        }

        .disabled-page > {
            a, span {
                color: $color_primary50;
            }
        }

        .active-page > {
            a, span {
                z-index: 2;
                color: #FFF;
                background-color: $highlight_blue;
                border-color: transparent;
                cursor: default;
            }
        }
    }
}

.top-pagination-bar {
    margin: 11px 0 7px;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
}

.bottom-pagination-bar {
    margin-top: 10px;
}

.alert {
    padding: 15px;
    margin-bottom: 20px;
    border: 1px solid transparent;
    border-radius: $widget_border_radius;
}

.alert-info {
    color: $color_info100;
    background-color: $color_info25;
    border-color: $color_info50;
}

.alert-warning {
    color: $color_warning100;
    background-color: $color_warning25;
    border-color: $color_warning50;
}

.alert-danger {
    color: $color_danger100;
    background-color: $color_danger25;
    border-color: $color_danger50;
}

.alert-dismissable, .alert-dismissible {
    padding-right: 35px;
}

.alert-dismissable .close, .alert-dismissible .close {
    position: relative;
    top: -2px;
    right: -21px;
    color: inherit;
}

.close {
    float: right;
    font-size: 21px;
    font-weight: 700;
    line-height: 1;
    color: $color_primary100;
    filter: alpha(opacity=20);
    opacity: 0.2;
}

a.close {
    text-decoration: none !important;
    font-size: 18px !important;
    line-height: 1;

    &:hover {
        color: $color_primary100;
    }
}

.close {
    &:focus, &:hover {
        color: #000;
        text-decoration: none;
        cursor: pointer;
        filter: alpha(opacity=50);
        opacity: 0.5;
    }
}

.badge {
    min-width: 10px;
    padding: 0 7px;
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
    color: #fff;
    text-align: center;
    white-space: nowrap;
    vertical-align: middle;
    background-color: #e84848;
    border-radius: 10px;
    box-sizing: border-box;
}

.form-submit-group {
    border-top: 1px solid rgba($color_primary100, 0.1);
    margin-top: 0.8em;
    padding-top: 0.5em;
    text-align: right;
}

.sidebox h3 {
    margin: 0 -5px;
    background: $color_primary75;
    border-radius: $widget_border_radius $widget_border_radius 0 0;
    color: $color_primary0;
    padding-top: 5px;
    padding-bottom: 5px;
    padding-left: 7px;
    font-size: 1.3em;
}

.sidebox h3 .fa {
    color: $color_primary0;
    float: right;
    margin: 0.2em 0.4em 0 0;
}

.sidebox-content {
    border: 1px solid $color_primary25;
    border-top: none;
    margin: 0 -5px;
    padding: 1px 0.5em 3px;

    &.sidebox-table {
        border: none;
        padding: 0;

        .table {
            margin: 0 !important;
        }
    }
}

.sidebox {
    border-top-left-radius: $widget_border_radius;
    border-top-right-radius: $widget_border_radius;
    padding: 0 5px !important;
    padding-bottom: 1.5em !important;
}

.ws-closed {
    position: sticky;
    top: 42px;
    background: $announcement_red;
    border-radius: 5px 5px 0 0;
    display: none;
}

.ws-closed a {
    display: block;
    padding: 7px 0;
    text-align: center;
    color: white;
    font-weight: 600;
}

.semibold {
    font-weight: 600;
}

.messages {
    list-style-type: none;
    padding: 0;

    li {
        padding: 1em 1.5em;
        margin-bottom: 1em;
        border: 1px solid transparent;
        border-radius: 5px;

        &.debug {
            color: $color_primary75;
            background-color: $color_primary10;
            border-color: $color_primary25;
        }

        &.info {
            color: $color_info100;
            background-color: $color_info25;
            border-color: $color_info50;
        }

        &.success {
            color: $color_success100;
            background-color: $color_success25;
            border-color: $color_success50;
        }

        &.warning {
            color: $color_warning100;
            background-color: $color_warning25;
            border-color: $color_warning50;
        }

        &.error {
            color: $color_danger100;
            background-color: $color_danger25;
            border-color: $color_danger50;
        }
    }
}

details {
    border: 1px solid $color_primary25;
    background: $color_primary5;
    padding: 5px 10px;
    border-radius: 4px;
}
